home *** CD-ROM | disk | FTP | other *** search
- Path: in1.uu.net!tandem!usenet
- From: Anatoli Mandelchtam <tolik@tarley_pc.loc201.tandem.com>
- Newsgroups: comp.lang.c++
- Subject: Re: READ THIS!!!!!!!!!!!
- Date: Fri, 02 Feb 1996 21:53:28 -0800
- Organization: Tandem Computers Inc., Cupertino, CA
- Message-ID: <3112F858.1E46@tarley_pc.loc201.tandem.com>
- References: <4em5fs$a86@ixnews4.ix.netcom.com> <4er65q$d8v@usenet1.sjc.in.sel.sony.com>
- NNTP-Posting-Host: miket_home1.fnord.tandem.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (Win95; I)
-
- Victor Marilao wrote:
- .>
- .> jeremyx@ix.netcom.com(Jeremy Johnston ) wrote:
- .> >
- .> > ok....now that I have your attention i need some help.
- .> >I can't get the following command to work & the compiler says that the
- .> >constant has too many characters.
- .> >
- .> > char dos;
- .> > if(dos=='dir')
- .> > goto b;
- .> >
- .> >How can i do this to get it to work? please help,I know you can.
- .> >
- .> >
- .>
- .> Try this:
- .>
- .> #include "stdio.h"
- .> #include "string.h"
- .>
- .> main()
- .> {
- .> char *dos;
- .> // strcpy(dos, "dir"); // Uncomment to test for a valid
- .> match
- .>
- .> if (strcmp(dos, "dir") == 0)
- .> printf("Its a match");
- .> }
- .>
- .> E-mail me if you need an explanation.
- .>
- .> Victor
-
- Memory! How about allocating some memory so that "dos" pointer doesn't point
- nowhere?
-